package top.simonby.iron.base.support;

import io.swagger.v3.oas.models.ExternalDocumentation;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;

/**
 * open doc API
 *
 * @author 91223
 */
public class OpenApiBuilder {

    public OpenAPI springOpenAPI(String version) {
        return new OpenAPI()
                .info(
                        new Info()
                                .title("SpringShop API")
                                .description("Spring shop sample application")
                                .version(version)
                                .license(
                                        new License()
                                                .name("Apache 2.0")
                                                .url("http://springdoc.org")
                                )
                )
                .externalDocs(
                        new ExternalDocumentation()
                                .description("SpringShop Wiki Documentation")
                                .url("https://springshop.wiki.github.org/docs")
                );
    }
}